<?php
	require_once('auth/autenticar.php');
	require_once('conectar.php');
	
	$idresto=mysql_real_escape_string($_POST['idresto']);
	
	$result = mysql_query("SELECT mr.id, r.nombre FROM  membersXrestaurants mr JOIN restaurant r ON mr.idrestaurant=r.id WHERE idrestaurant=$idresto AND member_id=".$_SESSION['SESS_MEMBER_ID']);
	if ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
		$_SESSION['Restaurant_ID'] = $idresto;
		$_SESSION['Restaurant_Name'] = $row['nombre'];
		echo '1';
	}else{
		echo '0';
	}

?>
